/**
 * Copyright (c) 2025 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

// Autogenerated file -- DO NOT EDIT!

#ifndef ES2PANDA_UTIL_DIAGNOSTIC_KIND_H
#define ES2PANDA_UTIL_DIAGNOSTIC_KIND_H

#include "util/diagnostic.h"
#include <tuple>

namespace ark::es2panda::diagnostic {

class DiagnosticKind {
public:
    constexpr DiagnosticKind(util::DiagnosticType type, uint32_t id, std::string_view message) :
        type_(type), id_(id), message_(message) {}

    bool operator==(const DiagnosticKind &other) const
    {
        return std::tie(type_, id_) == std::tie(other.type_, other.id_);
    }

    bool operator<(const DiagnosticKind &other) const
    {
        return std::tie(type_, id_) < std::tie(other.type_, other.id_);
    }

    util::DiagnosticType Type() const
    {
        return type_;
    }

    uint32_t Id() const
    {
        return id_;
    }

    std::string_view Message() const
    {
        return message_;
    }

private:
    const util::DiagnosticType type_;
    const uint32_t id_;
    const std::string_view message_;
};

% Diagnostic::diagnostics.each do |desc|
    constexpr static DiagnosticKind <%= desc.name %> {util::DiagnosticType::<%= desc.type.upcase %>, <%= desc.id %>, "<%= desc.message %>"};
% end
} // namespace ark::es2panda::diagnostic

#endif // ES2PANDA_UTIL_DIAGNOSTIC_KIND_H
